<template>
  <div class="train-tab">
    <el-dialog
      width="400px"
      title='波科国际医疗贸易(上海)有限公司'
      :visible.sync="modifyInfoVisible">
      <CreateTrain />
    </el-dialog>

    <el-table
      v-loading="loading"
      :data="tableData"
      stripe
      show-header
      style="width: 100%;">
      <el-table-column
        type="index"
        label="序号"
        width="56"/>
      <el-table-column
        prop="factory"
        label="原厂"
        width="200"/>
      <el-table-column
        prop="distributor"
        label="经销商"
        width="200"/>
      <el-table-column
        prop="trainType"
        label="培训类型"
        width="120"/>
      <el-table-column
        prop="trainResult"
        label="培训结果"
        width="80"/>
      <el-table-column
        prop="createdAt"
        label="通过时间"
        width="160"/>
      <el-table-column
        prop="trainUser"
        label="培训用户"
        width="80"/>

      <el-table-column
        label="培训证明"
        width="80">
        <template slot-scope="scope">
          <el-button
            @click="showDetail(scope.row)"
            type="text"
            size="small">查看
          </el-button>
        </template>
      </el-table-column>
      <el-table-column
        label="操作"
        width="100">
        <template slot-scope="scope">
          <el-button
            type="text"
            size="small"
            @click.native="modifyInfo(scope.row)">修改
          </el-button>
          <el-button
            type="text"
            size="small"
            style="color:#d85365;"
            @click.native="modifyInfo(scope.row)">删除
          </el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import AddForm from './addForm'
import CreateTrain from './createTrain'
export default {
  name: 'TrainTab',
  components: {
    AddForm, CreateTrain
  },
  data () {
    return {
      tableData: [
        {
          id: '123',
          factory: '北京爱立建医疗器械有限公司',
          distributor: '国科恒泰（北京）医疗科技股份有限公司',
          trainType: '药品知识培训',
          trainResult: '未通过',
          createdAt: '2019-04-02 13:12:12',
          trainUser: '李晓芬'
        },
        {
          id: '123',
          factory: '波科国际医疗贸易(上海)有限公司',
          distributor: '北京爱立建医疗器械有限公司',
          trainType: '药品知识培训',
          trainResult: '未通过',
          createdAt: '2019-04-02 13:12:12',
          trainUser: '李晓芬'
        },
        {
          id: '123',
          factory: '波科国际医疗贸易(上海)有限公司',
          distributor: '北京爱立建医疗器械有限公司',
          trainType: '政策知识培训',
          trainResult: '通过',
          createdAt: '2019-04-02 13:12:12',
          trainUser: '李晓芬'
        }
      ],
      modifyInfoVisible: false
    }
  },
  props: {
    loading: {
      type: Boolean,
      default: false
    }
  },
  methods: {
    //   修改信息
    modifyInfo (row) {
      this.modifyInfoVisible = true
    },
    handleClose (row) {
    },
    // 查看证明详情
    showDetail (row) {
      this.$router.push('/partnerShip/detail')
    }
  }
}
</script>

<style scoped lang="less">

</style>
